package com.lovar.gaming.api.controller;

import com.lovar.gaming.core.domain.R;
import com.lovar.gaming.dao.domain.BaseUserViewPost;
import com.lovar.gaming.service.BaseUserViewPostService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 穹龙
 * @description 针对表【base_user_view_post(用户浏览记录表)】的数据库操作Controller
 * @createDate 2024-08-06 17:09:56
*/
@RestController
@RequestMapping("/baseUserViewPost")
@RequiredArgsConstructor
public class BaseUserViewPostController {
    private BaseUserViewPostService baseUserViewPostService;

    /**
     * 根据Id获取用户浏览记录表详情
     *
     * @param query 查询参数
     * @return BaseUserViewPost
    */
    @PostMapping("/queryById")
    public R<BaseUserViewPost> queryById(@RequestBody BaseUserViewPost query) {
        return R.ok(baseUserViewPostService.queryById(query.getId()));
    }
}
